import { getNewsListApi } from '../../../../api/news.js';

Component({
  data: {
    newsList: [],
  },
  lifetimes: {
    created() {
      this.getNewsList();
    },
  },
  methods: {
    async getNewsList() {
      const data = await getNewsListApi({ limit: 3, hot: true });
      this.setData({
        newsList: data,
      });
      console.log(this.data.newsList);
    },
  },
});
